clear all


use "final_replication_data.dta", clear


set more off


****************************
*
*  Results in Main Text
*
****************************


*** Table 1 ***


reghdfe  ln_flow_m barrier_m if alldir==0, absorb(c1year c2year ddyad) cluster(dyad)

estimates store m1_1, title(Model 1)


reghdfe  ln_flow_m barrier_m dem_dyad ally_def rivalry_M terr_dispute if alldir==0, absorb(c1year c2year ddyad) cluster(dyad)

estimates store m1_2, title(Model 2)


reghdfe  ln_flow_m barrier_m dem_dyad ally_def rivalry_M terr_dispute ln_gdppc_ratio if alldir==0, absorb(c1year c2year ddyad) cluster(dyad)

estimates store m1_3, title(Model 3)


reghdfe  ln_flow_m barrier_m dem_dyad ally_def rivalry_M terr_dispute ptadum_new comcur bothin_m ln_gdppc_ratio if alldir==0, absorb(c1year c2year ddyad) cluster(dyad)

gen sample4=e(sample)

estimates store m1_4, title(Model 4)



ppml_panel_sg raw_importflow barrier_m dem_dyad ally_def rivalry_M gdppc_rat if alldir==1, importer(ccode1) exporter(ccode2) y(year)  clus(dyad) tolerance(1e-10) maxiter(12000)      

estimates store f1_1, title(Model 1)

ppml_panel_sg raw_importflow barrier_m dem_dyad ally_def rivalry_M ptadum_new comcur bothin_m gdppc_rat if alldir==1, importer(ccode1) exporter(ccode2) y(year)  clus(dyad) tolerance(1e-10) maxiter(12000)      

estimates store f1_2, title(Model 2)

ppml_panel_sg raw_importflow prop_walls_fts  dem_dyad ally_def rivalry_M gdppc_rat if alldir==1, importer(ccode1) exporter(ccode2) y(year)  clus(dyad) tolerance(1e-10) maxiter(12000)      

estimates store f1_3, title(Model 3)

ppml_panel_sg raw_importflow prop_walls_fts  dem_dyad ally_def rivalry_M ptadum_new comcur bothin_m gdppc_rat if alldir==1, importer(ccode1) exporter(ccode2) y(year)  clus(dyad) tolerance(1e-10) maxiter(12000)      

estimates store f1_4, title(Model 4)


estout m1_1 m1_2 m1_3 m1_4 f1_1 f1_2 f1_3 f1_4, style(tex) starlevels(* 0.10 ** 0.05) cells(b(star fmt(3)) se(par fmt(2))) stats(N) 


***********************************************
*
*** Oster Sensitivity Test Results, Model 4 ***
*
***********************************************



sort c1year

by c1year: center ln_flow_m barrier_m dem_dyad ally_def rivalry_M terr_dispute ln_gdppc_ratio ptadum_new comcur bothin_m


sort c2year

by c2year: center c_ln_flow_m-c_bothin_m



xtset ddyad


xtreg c_c_ln_flow_m c_c_barrier_m c_c_dem_dyad c_c_ally_def c_c_rivalry_M c_c_terr_dispute c_c_ln_gdppc_ratio c_c_ptadum_new c_c_comcur c_c_bothin_m if sample4==1, fe


* R2=R2 x 1.3 *

psacalc delta c_c_barrier_m, rmax(.01521)


* R2=R2 x 3 *

psacalc delta c_c_barrier_m, rmax(.0351)


* R2=R2 x 5 *

psacalc delta c_c_barrier_m, rmax(.0585)


* R2=R2 x 10 *

psacalc delta c_c_barrier_m, rmax(.117)



